//
//  SHD_MusicTableViewCell.m
//  B段项目
//
//  Created by dllo on 15/11/3.
//  Copyright © 2015年 谢美娜. All rights reserved.
//

#import "SHD_MusicTableViewCell.h"

@implementation SHD_MusicTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[myTitleLabel alloc]init];
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.textColor = [UIColor grayColor];
        _likeLabel = [[UILabel alloc]init];
        _likeLabel.textColor = [UIColor grayColor];
        _contectLabel = [[myContectLabel alloc]init];
        [self.contentView addSubview:_nameLabel];
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_contectLabel];
        [self.contentView addSubview:_likeLabel];
    }
    return self ;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _nameLabel.frame = CGRectMake(15 * FitWidth, 15 * FitHeight, 100 * FitWidth, 10 * FitHeight);
    [_nameLabel NightWithType:UIViewColorTypeNormal];
    _nameLabel.font = [UIFont fontWithName:@"STHeitiSC-Light" size:10 * FitWidth];
    _likeLabel.font = [UIFont fontWithName:@"STHeitiSC-Light" size:10 * FitWidth];
    _titleLabel.frame = CGRectMake(_nameLabel.frame.origin.x + 15, _nameLabel.frame.origin.y + _nameLabel.frame.size.height + 10 * FitHeight, 315 *FitWidth, 45 * FitHeight);
    _contectLabel.frame = CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.size.height + _titleLabel.frame.origin.y + 10 * FitHeight, 315 * FitWidth, 70 * FitHeight);
    _likeLabel.frame = CGRectMake(260 * FitWidth, _contectLabel.frame.origin.y + _contectLabel.frame.size.height + 10 * FitHeight, 100 * FitWidth, 10 * FitHeight);
    _likeLabel.textAlignment = 2;
    _titleLabel.numberOfLines = 0;
    _contectLabel.numberOfLines = 0;
    _titleLabel.textAlignment= 1;

    
    
}
-(void)setMusicList:(SHD_MusicList *)musicList
{
    _musicList = musicList;
    _nameLabel.text = [NSString stringWithFormat:@"%@ · %@", musicList.Name, musicList.enname];
    _titleLabel.text = musicList.title;
    _contectLabel.text = musicList.content;
    _likeLabel.text = [NSString stringWithFormat:@"有%@人喜欢", musicList.like];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
